﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XLib.Node;

namespace NodeLib.Sample
{
    public class EnumDataPinGroup<TData> : DataPinGroup
    {
        public EnumDataPinGroup(NodeBase node) : base(node) { }

        public EnumDataPinGroup(NodeBase node, string type, string name, string value) : base(node, type, name, value) { }

        public EnumDataPinGroup(NodeBase node, PinGroupType groupType, string name)
            : base(node)
        {
            this.GroupType = groupType;
            this.Type = typeof(TData).Name;
            this.Name = name;
            _EnumNames = new ObservableCollection<string>(Enum.GetNames(typeof(TData)));
        }

        public TData? Data { get; set; }

        private ObservableCollection<string> _EnumNames = new ObservableCollection<string>();
        public ObservableCollection<string> EnumNames
        {
            get => _EnumNames;
            set
            {
                _EnumNames = value;
            }
        }
    }
}
